<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>layout 后台大布局 - Layui</title>
<link th:href="@{../../layui/css/layui.css}" rel="stylesheet" />
</head>
<body>
	<div th:include="header :: right"></div> 
	<div class="layui-body">
    <ul style="padding: 53px 4px;" class="layui-tab-title">
      <li class="layui-this">任务列表</li>
      <li><a th:href="@{/task/form}">识别任务添加</a></li>
    </ul>
    <!-- 内容主体区域 -->
    <div>
	   <form class="layui-form" action="/task/list">
		  <div class="layui-form-item">
		    <label class="layui-form-label">文件名：</label>
		    <div class="layui-input-inline">
		      <input name="fileName" lay-verify="title" th:value="${queryObj.fileName}"   autocomplete="off" placeholder="请输入文件名" class="layui-input" type="text"/>
		    </div>
		    <div class="layui-form-item">
		    <label class="layui-form-label">任务类型：</label>
		    <div class="layui-input-inline">
		    	<select name="taskType" lay-filter="aihao">
			        <option value=""></option>
			        <span th:if="${'0' eq queryObj.taskType}" > 
			        	<option value="0" selected="selected">视频</option>
			        	<option value="1" >文本</option>
			        </span>
			        <span th:unless="${'0' eq queryObj.taskType}" > 
			        	<option value="0" >视频</option>
			        	<option value="1" selected="selected">文本</option>
			        </span>
			     </select>
		    </div>
		   </div>
		  </div>
		  <input type="submit" class="layui-btn layui-btn-radius" value="查询"/>
	  </form>
    	<table  class="layui-table" lay-skin="line">
				<thead>
					<tr> 
						<th>任务ID</th>
						<th>文件名</th>
						<th>创建时间</th>
						<th>修改时间</th>
						<th>任务类型</th>
						<th>处理状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<th:block th:each="task : ${page.content}">
						<tr>
							<td th:text="${task.taskId}"></td>
							<td th:text="${task.fileName}"></td>
							<td th:text="${#dates.format(task.createTime,'yyyy-MM-dd HH:mm:ss')}" ></td>
							<td th:text="${#dates.format(task.updateTime,'yyyy-MM-dd HH:mm:ss')}"></td>
							<td th:text="((${task.taskType} == '0')? '视频' : '文本')"></td>
							
							 <span  th:if="${#strings.equals(task.status,'INIT')}">
								 <td  th:text="初始化"/>
							</span>
							 <span  th:if="${#strings.equals(task.status,'RUNNING')}">
								 <td  th:text="运行"/>
							</span>
							<span th:if="${#strings.equals(task.status,'SUCCESS')}">
								 <td  th:text="成功"/>
							</span>
							<span th:if="${#strings.equals(task.status,'FAILED')}">
								 <td  th:text="失败"/>
							</span> 
							<!-- <td th:text="${task.status}"></td> -->
							<td> 
								 <a  th:href="${'/task/form?taskId='+task.taskId+'&amp;view=view'}" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
								  <!-- <a th:href="${'/task/form?taskId='+task.taskId}" class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> -->
								  <a th:href="${'/task/delete?taskId='+task.taskId}" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
							</td>
						</tr>
					</th:block>
				</tbody>
			</table> 
			<!-- 分页 -->
			<div th:include="page :: pager" th:remove="tag"/>  
    </div>
  </div>
  
  <div class="layui-footer">
    © layui.com - 底部固定区域
  </div>
  <script th:src="@{../../layui/layui.js}"></script>
<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;
  
});
layui.use('form', function(){
	  var form = layui.form;
	  
	  //各种基于事件的操作，下面会有进一步介绍
	});

$(document).ready(function(){ 
	$("nav").eq(0).addClass("layui-this");
	}); 
</script>	
	 
</body>
</html>